﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>

<form id="form1">
    <div class='myzh_right_content fr'>
        <p class='right_head_title'><span class="span1">我的 ></span> 操作</p>
        <div class="recharge-content">
            <input type="hidden" id="id" name="id" value="${id}"/>
            <div class="mt-10">
                <span class="fl mt-3 w-120">服务类型：</span>
                <select class="txt txt-1 fl w-220"  id="platform_id" name="platform_id">
                    <option value="0">-请选择服务类型-</option>
                    <c:forEach var="item" items="${platform_data}">
                        <option value="${item.id}">${item.platformname}</option>
                    </c:forEach>
                </select>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">接口地址：</span>
                <input type="text" class="txt txt-1 fl w-220" id="requrl" name="requrl" value="${data.requrl}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">服务名称：</span>
                <input type="text" class="txt txt-1 fl w-220" id="name" name="name" value="${data.name}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">执行频率cron表达式：</span>
                <input type="text" class="txt txt-1 fl w-220" id="exec_time" name="exec_time" value="${data.exec_time}">
                &nbsp;<a href="http://cron.qqe2.com/" target="_blank" style="color: red">cron表达式生成器</a>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">请求方式：</span>
                <select id="req_method" name="req_method" class="txt txt-1 fl w-220" >
                    <option value="0">post</option>
                    <option value="1">get</option>
                </select>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">参数：</span>
                <input type="text" class="txt txt-1 fl w-220" id="param" name="param" value="${data.param}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">参数类型：</span>
                <select id="paramtype" name="paramtype" class="txt txt-1 fl w-220">
                    <option value="0">json</option>
                    <option value="1">form</option>
                </select>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">服务说明：</span>
                <input type="text" class="txt txt-1 fl w-220" id="remark" name="remark" value="${data.remark}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">邮箱地址，分号分隔：</span>
                <input type="text" class="txt txt-1 fl w-220" id="emails" name="emails" value="${data.emails}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">手机号分号分隔：</span>
                <input type="text" class="txt txt-1 fl w-220" id="mobiles" name="mobiles" value="${data.mobiles}">
                <div class="cl"></div>
            </div>
            <div class="mt-30 ml-10">
                <input type="button" class="btn btn-1 fl w-100" value="${title}" onclick="add()">
                <input type="button" class="btn btn-2 fl w-100 ml-20" value="返回"
                       onclick="window.location='${basePath}/t_mng_quartzservice/list'">
            </div>
        </div>
    </div>
</form>
<div class='clear'></div>
<script type="text/javascript">
    $(function () {
        $("#req_method").val(${data.req_method});
        $("#paramtype").val(${data.paramtype});
        $("#platform_id").val(${data.platform_id});
    });
    function add() {
        $.post("${basePath}/ajax/t_mng_quartzservice/add", $("#form1").serialize(), function (d) {
            if (d.code == 1) {
                alert("成功");
                window.location = "${basePath}/t_mng_quartzservice/list";
                return;
            }
            alert("失败");
        });
    }
</script>


